<template>
  <div>
		<navbar title="配送地址" :disabled="true"></navbar>
        <div style="position:relative;top:46px;">
             <div>
                <van-tabs v-model="active">
                <van-tab title="免费配送">
                    <div style="margin:0.2rem;">
                          <van-field
                        v-model="frameNo"
                        label="收件人姓名"
                        type="textarea"
                        placeholder="请输入姓名"
                        rows="1"
                        autosize
                    />
                    <van-field
                        v-model="engineNo"
                        label="手机号码"
                        type="textarea"
                        placeholder="请输入手机号码"
                        rows="1"
                        autosize
                    />
                    <van-cell is-link @click="showPop2">
                        <template slot="title">
                            <span class="van-cell-text">投保地区</span>
                            <!-- <van-switch v-model="checked" size="20px" class="swich"/> -->
                            <span class="van-cell-text" style="position:absolute; left :105px; ">{{firstRegisterDate}}</span>
                        </template>
                    </van-cell>
                      <van-field
                        v-model="engineNo"
                        label="详细地址"
                        type="textarea"
                        placeholder="请输入详细地址"
                        rows="3"
                        autosize
                    />
                    </div>
                  
                    
                </van-tab>
                <van-tab title="上门自取">
                    <div style="margin:0.2rem;background:#fff;text-align:center; padding:0.2rem;">
                        <div>泰山保险 国泰民安</div>
                        <div>客户服务电话：0531 55764142</div>
                    </div>
                </van-tab>
                </van-tabs>
            </div>

         <div class="btnCon"> 
        <van-button size="large" type="default" @click="tihe">下一步</van-button>
        </div>
        </div>
       
       
  </div>
</template>

<script>
import navbar from "../components/navbar.vue";
import axios from "axios";
export default {
  components: { navbar },
  data() {
    return {
        active:0,
        frameNo:'',
        engineNo:'',
        firstRegisterDate:'',
        baseInfo: window.localStorage.getItem("baseInfo")
    }
  },
  mounted(){
   
  },
  methods: {
//    ...
    showPop2(){},
    //  tihe(){
    //      console.log(1)
    //     this.$router.push({
    //         name: "updateVideo",
    //         query: {
            
    //         }
    //     });
    //  },
    tihe(){
        axios
        .post(
          "/api/ebusiness/intefPropertyInsuranceServlet?actionType=saveOrderToCore",
          {
            "baseInfo":JSON.parse(this.baseInfo),
             "addressInfo":{
                "phoneNumber": "15873259888",
                "provinceCode": "130000",
                "cityCode": "130100",
                "provinceCName": "河北省",
                "orderAddress": "河北省石家庄桥西区城市中坚1201",
                "receiveName": "甄领娣",
                "orderDay": "2018-11-21",
                "countyCName": "桥西区",
                "cityCName": "石家庄市",
                "countyCode": "130105"
            },
          } )
        .then(res => {
            // console.log(res.data.status)
            if(res.data.status == "succ"){
                console.log(res.data)
                if(res.data.data.submitCoreInfo.retCode == '1'){
                    this.toToubao()
                }else if(res.data.data.submitCoreInfo.retCode == '0'){
                    this.$dialog.confirm({
                    title: '提示',
                    message: res.data.data.submitCoreInfo.retMsg
                    }).then(() => {
                    // on confirm
                        this.$router.push({
                            name: "updateVideo",
                            query: {
                            
                            }
                        });
                    }).catch(() => {
                    // on cancel
                    });
                }
            }else{
                  Toast('请求超时，请稍后再试');
            }
        })
    },
    toToubao:function(){
        this.$router.push({
              name: "underWriteSus",
              query: {
              
              }
            });
    }    
  }
};
</script>
<style scoped lang="scss">
    .con{
        padding: 10px 15px;
        background: #fff;
        .con_c{
            display: flex;
           div{
               width: 50%;

           }
        }
    }
     .btnCon{
    width: 10rem;
    position: fixed;
    bottom: 0;
    background: #fff;
  }
</style>
